import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from "@angular/router";
import { MyHttp } from "../../../../service/MyHttp";
@Component({
  selector: 'app-devicelist',
  templateUrl: './devicelist.component.html',
  styleUrls: ['./devicelist.component.css']
})
export class DevicelistComponent implements OnInit {

  private productId:string = '';
  public data;
  constructor(private myHttp:MyHttp,private activeRoute:ActivatedRoute) {
    this.activeRoute.params.subscribe(params=>{
      if(params['productId']){
        this.productId = params['productId'];
        this.getData();
      }
    })
   }

  ngOnInit() {
  }

  private getData(){
    this.myHttp.post('locker/findByProduct',{locker_category:this.productId}).subscribe(res=>{
      if(res.errorCode ==0){
        this.data = res.message;
      }
    });
  }
  

}
